<?php
  require("../global.php");
  require("../json/JSON.php");
	header("Content-type: text/html;charset=UTF-8");
	ob_start("ob_gzhandler"); 

	if(isset($_GET['pageIndex']))
{
  $id=intval($_GET['pageIndex']) ? intval($_GET['pageIndex']) : 1;
}else{
  $_GET['getPageCount'] = isset($_GET['getPageCount']) ? $_GET['getPageCount'] : 1; 
  $id=intval($_GET['getPageCount']) ? intval($_GET['getPageCount']) : 1; 
}

//$offnum = 20;
   $offset = ($id-1)*$num;



    $sql="select log_id,login_no,login_time,login_ip from `dloginlog` order by login_time desc "; 
    $PageCount = $db->get_num_rows($sql);
    
    if(isset($_GET['getPageCount']))
    {
    	echo ceil($PageCount/$num);
    }else{
    $sql .="   limit $offset,$num " ;
    //echo $sql;
    //$db->query("set names'utf8'");
    $row=$db->get_sql_arr($sql); 
    
    if(function_exists(json_encode))
    {
      echo  urldecode (json_encode($row));
    }else{
      $json = new Services_JSON();
      
      echo  urldecode ($json->encode($row));
      
    }
 }
?>	